const proxy = require("http-proxy-middleware");

module.exports = function (app) {
    app.use(
        proxy('/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/user/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/machine/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/upload/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/worker/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/nsq/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/nsq/gets/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/seed/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/columns/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/data/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
    app.use(
        proxy('/self/*', {
            target: 'http://graduation.moyrn.com',
            changeOrigin: true,
        }));
};